home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 1
/
Precision Software Applications Silver Collection Volume One (PSM) (1993).iso
/
tutor
/
clipper.exe
/
REPLIC.PRG
< prev
next >
Wrap
Text File
|
1985-07-02
|
5KB
|
173 lines
* program replic.prg - a demo of the replicate() function in use
*
*
set colo to w/
clear
Null = 0
Esc = 27
lpr = 0
clr = 'w/'
frame = chr(201) + chr(205) + chr(187) + chr(186) + chr(188) + ;
chr(205) + chr(200) + chr(186) + chr(176)
SLBOX = chr(218) + chr(196) + chr(191) + chr(179) + chr(217) + ;
chr(196) + chr(192) + chr(179) + chr(32)
@ 0,0,4,79 box frame
@ 20,0,23,79 box frame
set color to /w
@ 2,2 say 'Current time :- '
set color to r/w
@ 2,18 say time()
set color to /w
@ 1,30 say ' CLIPPER - The dBASE III Compiler '
@ 2,30 say 'Demonstration of Clipper REPLICATE() function '
set color to gr+/
@ 3,30 say ' dBASE III comes of age '
set color to w/r
@ 6,12 say 'Hit the key you want to Replicate or ESCAPE to exit'
do while lpr <> Esc
Do While inkey() = Null
set color to r/w
@ 2,18 say time()
Enddo
set color to &clr
@ 8,0,10,79 box slbox
if clr = 'w/'
clr = 'gr/'
else
clr = 'w/'
endif
lpr = lastkey()
repchar = chr(lastkey())
@ 9,5 say space (70)
if lastkey() <> Esc
@ 9,5 say replicate(repchar,70)
endif
set color to r/w
@ 12,10 say ' The line above is the key pressed replicated 70 times...... '
If lastkey() <= 256
set color to gr+/
If lastkey() = ESC
@ 16,25 say space(54)
@ 16,25 say 'You have just hit the [ESC] key '
else
@ 16,25 say space(54)
@ 16,25 say 'You have just hit the key [' + chr(lastkey()) + ']'
endif
endif
if lastkey() > 256
do case
case lastkey() = 19200
kar = chr(27)
case lastkey() = 19712
kar = chr(26)
case lastkey() = 18432
kar = chr(24)
case lastkey() = 20480
kar = chr(25)
case lastkey() = 18176
kar = 'HOME'
case lastkey() = 20224
kar = 'END'
case lastkey() = 18688
kar = 'PAGEUP'
case lastkey() = 20736
kar = 'PAGEDOWN'
case lastkey() = 9
kar = 'TAB'
case lastkey() = 20992
kar = 'INSERT'
case lastkey() = 21248
kar = 'DEL'
case lastkey() = 15104
kar = 'F1'
case lastkey() = 15360
kar = 'F2'
case lastkey() = 15616
kar = 'F3'
case lastkey() = 15872
kar = 'F4'
case lastkey() = 16128
kar = 'F5'
case lastkey() = 16384
kar = 'F6'
case lastkey() = 16640
kar = 'F7'
case lastkey() = 16896
kar = 'F8'
case lastkey() = 17152
kar = 'F9'
case lastkey() = 17408
kar = 'F10'
case lastkey() = 21504
kar = 'SHIFT F1'
case lastkey() = 21760
kar = 'SHIFT F2'
case lastkey() = 22016
kar = 'SHIFT F3'
case lastkey() = 22272
kar = 'SHIFT F4'
case lastkey() = 22528
kar = 'SHIFT F5'
case lastkey() = 22784
kar = 'SHIFT F6'
case lastkey() = 23040
kar = 'SHIFT F7'
case lastkey() = 23296
kar = 'SHIFT F8'
case lastkey() = 23552
kar = 'SHIFT F9'
case lastkey() = 23808
kar = 'SHIFT F10'
case lastkey() = 24064
kar = 'CTRL F1'
case lastkey() = 24320
kar = 'CTRL F2'
case lastkey() = 24576
kar = 'CTRL F3'
case lastkey() = 24832
kar = 'CTRL F4'
case lastkey() = 25088
kar = 'CTRL F5'
case lastkey() = 25344
kar = 'CTRL F6'
case lastkey() = 25600
kar = 'CTRL F7'
case lastkey() = 25856
kar = 'CTRL F8'
case lastkey() = 26112
kar = 'CTRL F9'
case lastkey() = 26368
kar = 'CTRL F10'
case lastkey() = 26624
kar = 'ALT F1'
case lastkey() = 26880
kar = 'ALT F2'
case lastkey() = 27136
kar = 'ALT F3'
case lastkey() = 27392
kar = 'ALT F4'
case lastkey() = 27648
kar = 'ALT F5'
case lastkey() = 27904
kar = 'ALT F6'
case lastkey() = 28160
kar = 'ALT F7'
case lastkey() = 28416
kar = 'ALT F8'
case lastkey() = 28672
kar = 'ALT F9'
case lastkey() = 28928
kar = 'ALT F10'
otherwise
kar = ' NO CHARACTER '
ENDCASE
set color to gr/
@ 16,25 say space(54)
@ 16,25 say 'You have just hit a non-printable key [' + kar + ']'
endif
enddo
@ 22,0
set color to w/
Return